﻿using NopSolutions.NopCommerce.BusinessLogic.Configuration.Settings;

namespace MediaCoders.NopCommerce.Code.MultiSafePay
{
    public class MultiSafePayPaymentSettings
    {
        #region Properties
        /// <summary>
        /// Indicates if this a MultiSafePay test account
        /// </summary>
        public static bool TestAccount
        {
            get
            {
                return (SettingManager.GetSettingValue("PaymentMethod.MultiSafePay.TestAccount") == true.ToString());
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.MultiSafePay.TestAccount", value.ToString());
            }
        }

        /// <summary>
        /// Indicates of payment statusses should be updated by MultiSafePay
        /// </summary>
        public static bool AutoStatusProcess
        {
            get
            {
                return (SettingManager.GetSettingValue("PaymentMethod.MultiSafePay.AutoStatusProcess") == true.ToString());
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.MultiSafePay.AutoStatusProcess", value.ToString());
            }
        }

        /// <summary>
        /// Indicates if the order should be cancelled when the payment is cancelled
        /// </summary>
        public static bool CancelOrderOnPaymentCancel
        {
            get
            {
                return (SettingManager.GetSettingValue("PaymentMethod.MultiSafePay.CancelOrderOnPaymentCancel") == true.ToString());
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.MultiSafePay.CancelOrderOnPaymentCancel", value.ToString());
            }
        }

        /// <summary>
        /// Gets or sets the Account Id
        /// </summary>
        public static string AccountId
        {
            get
            {
                return SettingManager.GetSettingValue("PaymentMethod.MultiSafePay.AccountId");
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.MultiSafePay.AccountId", value);
            }
        }

        /// <summary>
        /// Gets or sets the Site Id
        /// </summary>
        public static string SiteId
        {
            get
            {
                return SettingManager.GetSettingValue("PaymentMethod.MultiSafePay.SiteId");
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.MultiSafePay.SiteId", value);
            }
        }

        /// <summary>
        /// Gets or sets the Sitde Code
        /// </summary>
        public static string SiteCode
        {
            get
            {
                return SettingManager.GetSettingValue("PaymentMethod.MultiSafePay.SiteCode");
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.MultiSafePay.SiteCode", value);
            }
        }

        /// <summary>
        /// Gets or sets the additional fee for this payment method
        /// </summary>
        public static decimal AdditionalFee
        {
            get
            {
                return SettingManager.GetSettingValueDecimalNative("PaymentMethod.MultiSafePay.AdditionalFee");
            }
            set
            {
                SettingManager.SetParamNative("PaymentMethod.MultiSafePay.AdditionalFee", value);
            }
        }
        #endregion
    }
}
